key_up

This function checks if a particular key on the keyboard is currently up.

bool key_up(int key)

Parameters:
key
One of the BGT key name constants, see appendix A for a full list.

Return value:
true if the key is up, false if it is not or if an error occurs.

Remarks:
The difference between key_up and key_released is that key_released will only return true when the user first releases the key, while key_up will continue returning true until the key is pushed down again.

Example:
// Time how long the space bar is up.

void main()
{
timer up;
show_game_window("keyboard Test");
up.restart();
while(!key_pressed(KEY_ESCAPE))
{
if(key_up(KEY_SPACE))
{
continue;
}
alert("Time", "The space bar has been up for "+(up.elapsed/1000)+" seconds.");
}
}
}